From ed3a5e71bdb56894bd9d92181b0a3e8ceb3c4c77 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Wed, 2 Aug 2006 09:52:03 +0100 Subject: [PATCH] [HVM] Initialise full regs structure for PIO requests. Signed-off-by: Keir Fraser --- xen/arch/x86/hvm/io.c | 5 ++--- xen/arch/x86/hvm/platform.c | 1 - xen/arch/x86/hvm/svm/svm.c | 1 + xen/arch/x86/hvm/vmx/vmx.c | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c index 4be6afdc01..6549f8946d 100644 --- a/xen/arch/x86/hvm/io.c +++ b/xen/arch/x86/hvm/io.c @@ -695,12 +695,11 @@ void hvm_io_assist(struct vcpu *v) if ( p->type == IOREQ_TYPE_PIO ) hvm_pio_assist(regs, p, io_opp); - else { + else hvm_mmio_assist(regs, p, io_opp); - hvm_load_cpu_guest_regs(v, regs); - } /* Copy register changes back into current guest state. */ + hvm_load_cpu_guest_regs(v, regs); memcpy(guest_cpu_user_regs(), regs, HVM_CONTEXT_STACK_BYTES); } /* else an interrupt send event raced us */ diff --git a/xen/arch/x86/hvm/platform.c b/xen/arch/x86/hvm/platform.c index d2044fca43..1b5c5966af 100644 --- a/xen/arch/x86/hvm/platform.c +++ b/xen/arch/x86/hvm/platform.c @@ -827,7 +827,6 @@ void handle_mmio(unsigned long va, unsigned long gpa) /* Copy current guest state into io instruction state structure. */ memcpy(regs, guest_cpu_user_regs(), HVM_CONTEXT_STACK_BYTES); - hvm_store_cpu_guest_regs(v, regs, NULL); if ((inst_len = hvm_instruction_length(v)) <= 0) { diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 4490bd7f5f..01d48b2524 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1416,6 +1416,7 @@ static void svm_io_instruction(struct vcpu *v) /* Copy current guest state into io instruction state structure. */ memcpy(regs, guest_cpu_user_regs(), HVM_CONTEXT_STACK_BYTES); + hvm_store_cpu_guest_regs(v, regs, NULL); info.bytes = vmcb->exitinfo1; diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 66991e0a0e..6dfea007aa 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -1107,6 +1107,7 @@ static void vmx_io_instruction(unsigned long exit_qualification, /* Copy current guest state into io instruction state structure. */ memcpy(regs, guest_cpu_user_regs(), HVM_CONTEXT_STACK_BYTES); + hvm_store_cpu_guest_regs(current, regs, NULL); __vmread(GUEST_RIP, &eip); __vmread(GUEST_CS_SELECTOR, &cs); -- 2.30.2